﻿using System;
using CCM = CodeCamp.Model;

namespace CodeCamp.Models.Email
{
    public class MailCampaignListItem
    {
        public MailCampaignListItem() { }
        public MailCampaignListItem(CCM.EmailCampaign ec)
        {
            if (ec != null)
            {
                this.Id = ec.Id;
                this.EventId = ec.Event.Id;
                this.EventShortName = ec.Event.ShortName;
                this.Status = ec.CampaignStatus;
                this.RecipientType = ec.RecipientType;
                this.Subject = ec.Subject;
                this.CreatedBy = ec.CreatedBy;
                this.CreatedUTC = ec.CreatedUTC;
                this.UpdatedBy = ec.UpdatedBy;
                this.UpdatedUTC = ec.UpdatedUTC;
            }
        }
        public int Id { get; set; }
        public int EmailsTotal { get; set; }
        public int EmailsSent { get; set; }
        public bool EnableAddEmail { get; set; }
        public bool EnableEdit { get; set; }
        public bool EnableListEmails { get; set; }
        public int EventId { get; set; }
        public string EventShortName { get; set; }
        public CCM.EmailCampaign.EmailCampaignStatus Status { get; set; }
        public CCM.EmailCampaign.EmailRecipientType RecipientType { get; set; }
        public string Subject { get; set; }
        public string CreatedBy { get; set; }
        public DateTime CreatedUTC { get; protected set; }
        public string UpdatedBy { get; set; }
        public Nullable<DateTime> UpdatedUTC { get; set; }
    }
}